package com.huohuzhihui.contract;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.fisco.bcos.sdk.abi.FunctionReturnDecoder;
import org.fisco.bcos.sdk.abi.TypeReference;
import org.fisco.bcos.sdk.abi.datatypes.Event;
import org.fisco.bcos.sdk.abi.datatypes.Function;
import org.fisco.bcos.sdk.abi.datatypes.Type;
import org.fisco.bcos.sdk.abi.datatypes.Utf8String;
import org.fisco.bcos.sdk.abi.datatypes.generated.Int256;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple1;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple6;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple7;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.contract.Contract;
import org.fisco.bcos.sdk.crypto.CryptoSuite;
import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.eventsub.EventCallback;
import org.fisco.bcos.sdk.model.CryptoType;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.fisco.bcos.sdk.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;

@SuppressWarnings("unchecked")
public class DigitalAssetShard extends Contract {
    public static final String[] BINARY_ARRAY = {"608060405234801561001057600080fd5b5061002861002d640100000000026401000000009004565b6101ab565b600061100190508073ffffffffffffffffffffffffffffffffffffffff166356004b6a6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018060200180602001848103845260188152602001807f745f636f6c6c656374696f6e5f61737365745f73686172640000000000000000815250602001848103835260088152602001807f73686172645f69640000000000000000000000000000000000000000000000008152506020018481038252603a8152602001807f61737365745f69642c66726f6d5f616464726573732c746f5f6164647265737381526020017f2c7472616e736665725f747970652c6372656174655f74696d650000000000008152506040019350505050602060405180830381600087803b15801561016c57600080fd5b505af1158015610180573d6000803e3d6000fd5b505050506040513d602081101561019657600080fd5b81019080805190602001909291905050505050565b611e3080620001bb6000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632eb75a1014610051578063fcd7e3c11461022c575b600080fd5b34801561005d57600080fd5b50610216600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610531565b6040518082815260200191505060405180910390f35b34801561023857600080fd5b50610293600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506111a8565b6040518088815260200180602001806020018060200180602001806020018060200187810387528d818151815260200191508051906020019080838360005b838110156102ed5780820151818401526020810190506102d2565b50505050905090810190601f16801561031a5780820380516001836020036101000a031916815260200191505b5087810386528c818151815260200191508051906020019080838360005b83811015610353578082015181840152602081019050610338565b50505050905090810190601f1680156103805780820380516001836020036101000a031916815260200191505b5087810385528b818151815260200191508051906020019080838360005b838110156103b957808201518184015260208101905061039e565b50505050905090810190601f1680156103e65780820380516001836020036101000a031916815260200191505b5087810384528a818151815260200191508051906020019080838360005b8381101561041f578082015181840152602081019050610404565b50505050905090810190601f16801561044c5780820380516001836020036101000a031916815260200191505b50878103835289818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b50878103825288818151815260200191508051906020019080838360005b838110156104eb5780820151818401526020810190506104d0565b50505050905090810190601f1680156105185780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b600080600061053e611dcd565b6000806000809550600094506105538d6111a8565b8595508494508393508292508191508090508a6000018b6020018c6040018d6060018e6080018f60a001869052869052869052869052869052869052869b5050505050505050600085141515610eac576105ab611cde565b92508273ffffffffffffffffffffffffffffffffffffffff166313db93466040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561061157600080fd5b505af1158015610625573d6000803e3d6000fd5b505050506040513d602081101561063b57600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff1663e942b5168e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808060200180602001838103835260088152602001807f73686172645f6964000000000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b8381101561070e5780820151818401526020810190506106f3565b50505050905090810190601f16801561073b5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561075b57600080fd5b505af115801561076f573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff1663e942b5168d6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808060200180602001838103835260088152602001807f61737365745f6964000000000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610833578082015181840152602081019050610818565b50505050905090810190601f1680156108605780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561088057600080fd5b505af1158015610894573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff1663e942b5168c6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600c8152602001807f66726f6d5f616464726573730000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b8381101561095857808201518184015260208101905061093d565b50505050905090810190601f1680156109855780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff1663e942b5168b6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600a8152602001807f746f5f6164647265737300000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610a7d578082015181840152602081019050610a62565b50505050905090810190601f168015610aaa5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff1663e942b5168a6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600d8152602001807f7472616e736665725f7479706500000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610ba2578082015181840152602081019050610b87565b50505050905090810190601f168015610bcf5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610bef57600080fd5b505af1158015610c03573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff1663e942b516896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600b8152602001807f6372656174655f74696d65000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610cc7578082015181840152602081019050610cac565b50505050905090810190601f168015610cf45780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610d1457600080fd5b505af1158015610d28573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff166331afac368e846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b83811015610de7578082015181840152602081019050610dcc565b50505050905090810190601f168015610e145780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015610e3457600080fd5b505af1158015610e48573d6000803e3d","6000fd5b505050506040513d6020811015610e5e57600080fd5b810190808051906020019092919050505090506001811415610e835760009550610ea7565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe95505b610ed0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff95505b7f660baf0b8d6c0aecb43eaee52e1738a62747821439a0e3be5996dde45427bd86868e8e8e8e8e8e6040518088815260200180602001806020018060200180602001806020018060200187810387528d818151815260200191508051906020019080838360005b83811015610f52578082015181840152602081019050610f37565b50505050905090810190601f168015610f7f5780820380516001836020036101000a031916815260200191505b5087810386528c818151815260200191508051906020019080838360005b83811015610fb8578082015181840152602081019050610f9d565b50505050905090810190601f168015610fe55780820380516001836020036101000a031916815260200191505b5087810385528b818151815260200191508051906020019080838360005b8381101561101e578082015181840152602081019050611003565b50505050905090810190601f16801561104b5780820380516001836020036101000a031916815260200191505b5087810384528a818151815260200191508051906020019080838360005b83811015611084578082015181840152602081019050611069565b50505050905090810190601f1680156110b15780820380516001836020036101000a031916815260200191505b50878103835289818151815260200191508051906020019080838360005b838110156110ea5780820151818401526020810190506110cf565b50505050905090810190601f1680156111175780820380516001836020036101000a031916815260200191505b50878103825288818151815260200191508051906020019080838360005b83811015611150578082015181840152602081019050611135565b50505050905090810190601f16801561117d5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390a18596505050505050509695505050505050565b600060608060608060608060008060006111c0611cde565b92508273ffffffffffffffffffffffffffffffffffffffff1663e8434e398c8573ffffffffffffffffffffffffffffffffffffffff16637857d7c96040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561124357600080fd5b505af1158015611257573d6000803e3d6000fd5b505050506040513d602081101561126d57600080fd5b81019080805190602001909291905050506040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b8381101561131b578082015181840152602081019050611300565b50505050905090810190601f1680156113485780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561136857600080fd5b505af115801561137c573d6000803e3d6000fd5b505050506040513d602081101561139257600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff1663949d225d6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561140957600080fd5b505af115801561141d573d6000803e3d6000fd5b505050506040513d602081101561143357600080fd5b8101908080519060200190929190505050600014156114e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8090506020604051908101604052806000815250602060405190810160405280600081525060206040519081016040528060008152506020604051908101604052806000815250602060405190810160405280600081525060206040519081016040528060008152509950995099509950995099509950611cd0565b8173ffffffffffffffffffffffffffffffffffffffff1663846719e060006040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15801561155957600080fd5b505af115801561156d573d6000803e3d6000fd5b505050506040513d602081101561158357600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff16639c981fcb6040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825260088152602001807f73686172645f6964000000000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b15801561163857600080fd5b505af115801561164c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561167657600080fd5b81019080805164010000000081111561168e57600080fd5b828101905060208101848111156116a457600080fd5b81518560018202830111640100000000821117156116c157600080fd5b50509291905050508273ffffffffffffffffffffffffffffffffffffffff16639c981fcb6040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825260088152602001807f61737365745f6964000000000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b15801561176957600080fd5b505af115801561177d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156117a757600080fd5b8101908080516401000000008111156117bf57600080fd5b828101905060208101848111156117d557600080fd5b81518560018202830111640100000000821117156117f257600080fd5b50509291905050508373ffffffffffffffffffffffffffffffffffffffff16639c981fcb6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600c8152602001807f66726f6d5f616464726573730000000000000000000000000000000000000000815250602001915050600060405180830381600087803b15801561189a57600080fd5b505af11580156118ae573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156118d857600080fd5b8101908080516401000000008111156118f057600080fd5b8281019050602081018481111561190657600080fd5b815185600182028301116401000000008211171561192357600080fd5b50509291905050508473ffffffffffffffffffffffffffffffffffffffff16639c981fcb6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600a8152602001807f746f5f6164647265737300000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b1580156119cb57600080fd5b505af11580156119df573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611a0957600080fd5b810190808051640100000000811115611a2157600080fd5b82810190506020810184811115611a3757600080fd5b8151856001820283011164010000000082111715611a5457600080fd5b50509291905050508573ffffffffffffffffffffffffffffffffffffffff16639c981fcb6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600d8152602001807f7472616e736665725f7479706500000000000000000000000000000000000000815250602001915050600060405180830381600087803b158015611afc57600080fd5b505af1158015611b10573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611b3a57600080fd5b810190808051640100000000811115611b5257600080fd5b82810190506020810184811115611b6857600080fd5b8151856001820283011164010000000082111715611b8557600080fd5b50509291905050508673ffffffffffffffffffffffffffffffffffffffff16639c981fcb6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600b8152602001807f6372656174655f74696d65000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b158015611c2d57600080fd5b505af1158015611c41573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611c6b57600080fd5b810190808051640100000000811115611c8357600080fd5b82810190506020810184811115611c9957600080fd5b8151856001820283011164010000000082111715611cb657600080fd5b505092919050505086965099509950995099509950995099505b505050919395979092949650565b600080600061100191508173ffffffffffffffffffffffffffffffffffffffff1663f23f63c96040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825260188152602001807f745f636f6c6c656374696f6e5f61737365745f73686172640000000000000000815250602001915050602060405180830381600087803b158015611d8857600080fd5b505af1158015611d9c573d6000803e3d6000fd5b505050506040513d6020811015611db257600080fd5b81019080805190602001909291905050509050809250505090565b60c06040519081016040528060608152602001606081526020016060815260200160608152602001606081526020016060815250905600a165627a7a72305820475d48dce6984bdaaaa8a1e1970b92c59a914cc7ab98550d411f5b628e59c1850029"};

    public static final String BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {"608060405234801561001057600080fd5b5061002861002d640100000000026401000000009004565b6101ab565b600061100190508073ffffffffffffffffffffffffffffffffffffffff1663c92a78016040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018060200180602001848103845260188152602001807f745f636f6c6c656374696f6e5f61737365745f73686172640000000000000000815250602001848103835260088152602001807f73686172645f69640000000000000000000000000000000000000000000000008152506020018481038252603a8152602001807f61737365745f69642c66726f6d5f616464726573732c746f5f6164647265737381526020017f2c7472616e736665725f747970652c6372656174655f74696d650000000000008152506040019350505050602060405180830381600087803b15801561016c57600080fd5b505af1158015610180573d6000803e3d6000fd5b505050506040513d602081101561019657600080fd5b81019080805190602001909291905050505050565b611e3080620001bb6000396000f30060806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063289fe8ae146100515780635b325d781461022c575b600080fd5b34801561005d57600080fd5b50610216600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610531565b6040518082815260200191505060405180910390f35b34801561023857600080fd5b50610293600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506111a8565b6040518088815260200180602001806020018060200180602001806020018060200187810387528d818151815260200191508051906020019080838360005b838110156102ed5780820151818401526020810190506102d2565b50505050905090810190601f16801561031a5780820380516001836020036101000a031916815260200191505b5087810386528c818151815260200191508051906020019080838360005b83811015610353578082015181840152602081019050610338565b50505050905090810190601f1680156103805780820380516001836020036101000a031916815260200191505b5087810385528b818151815260200191508051906020019080838360005b838110156103b957808201518184015260208101905061039e565b50505050905090810190601f1680156103e65780820380516001836020036101000a031916815260200191505b5087810384528a818151815260200191508051906020019080838360005b8381101561041f578082015181840152602081019050610404565b50505050905090810190601f16801561044c5780820380516001836020036101000a031916815260200191505b50878103835289818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b50878103825288818151815260200191508051906020019080838360005b838110156104eb5780820151818401526020810190506104d0565b50505050905090810190601f1680156105185780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b600080600061053e611dcd565b6000806000809550600094506105538d6111a8565b8595508494508393508292508191508090508a6000018b6020018c6040018d6060018e6080018f60a001869052869052869052869052869052869052869b5050505050505050600085141515610eac576105ab611cde565b92508273ffffffffffffffffffffffffffffffffffffffff16635887ab246040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561061157600080fd5b505af1158015610625573d6000803e3d6000fd5b505050506040513d602081101561063b57600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff16631a391cb48e6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808060200180602001838103835260088152602001807f73686172645f6964000000000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b8381101561070e5780820151818401526020810190506106f3565b50505050905090810190601f16801561073b5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561075b57600080fd5b505af115801561076f573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16631a391cb48d6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808060200180602001838103835260088152602001807f61737365745f6964000000000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610833578082015181840152602081019050610818565b50505050905090810190601f1680156108605780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561088057600080fd5b505af1158015610894573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16631a391cb48c6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600c8152602001807f66726f6d5f616464726573730000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b8381101561095857808201518184015260208101905061093d565b50505050905090810190601f1680156109855780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b1580156109a557600080fd5b505af11580156109b9573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16631a391cb48b6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600a8152602001807f746f5f6164647265737300000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610a7d578082015181840152602081019050610a62565b50505050905090810190601f168015610aaa5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16631a391cb48a6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600d8152602001807f7472616e736665725f7479706500000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610ba2578082015181840152602081019050610b87565b50505050905090810190601f168015610bcf5780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610bef57600080fd5b505af1158015610c03573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16631a391cb4896040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001806020018381038352600b8152602001807f6372656174655f74696d65000000000000000000000000000000000000000000815250602001838103825284818151815260200191508051906020019080838360005b83811015610cc7578082015181840152602081019050610cac565b50505050905090810190601f168015610cf45780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b158015610d1457600080fd5b505af1158015610d28573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff16634c6f30c08e846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b83811015610de7578082015181840152602081019050610dcc565b50505050905090810190601f168015610e145780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015610e3457600080fd5b505af1158015610e48573d6000803e3d","6000fd5b505050506040513d6020811015610e5e57600080fd5b810190808051906020019092919050505090506001811415610e835760009550610ea7565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe95505b610ed0565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff95505b7fba5c160b96d21ca972c429f288c76af6b3d6f7def89d0b82999590892e15b546868e8e8e8e8e8e6040518088815260200180602001806020018060200180602001806020018060200187810387528d818151815260200191508051906020019080838360005b83811015610f52578082015181840152602081019050610f37565b50505050905090810190601f168015610f7f5780820380516001836020036101000a031916815260200191505b5087810386528c818151815260200191508051906020019080838360005b83811015610fb8578082015181840152602081019050610f9d565b50505050905090810190601f168015610fe55780820380516001836020036101000a031916815260200191505b5087810385528b818151815260200191508051906020019080838360005b8381101561101e578082015181840152602081019050611003565b50505050905090810190601f16801561104b5780820380516001836020036101000a031916815260200191505b5087810384528a818151815260200191508051906020019080838360005b83811015611084578082015181840152602081019050611069565b50505050905090810190601f1680156110b15780820380516001836020036101000a031916815260200191505b50878103835289818151815260200191508051906020019080838360005b838110156110ea5780820151818401526020810190506110cf565b50505050905090810190601f1680156111175780820380516001836020036101000a031916815260200191505b50878103825288818151815260200191508051906020019080838360005b83811015611150578082015181840152602081019050611135565b50505050905090810190601f16801561117d5780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390a18596505050505050509695505050505050565b600060608060608060608060008060006111c0611cde565b92508273ffffffffffffffffffffffffffffffffffffffff1663d8ac59578c8573ffffffffffffffffffffffffffffffffffffffff1663c74f8caf6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561124357600080fd5b505af1158015611257573d6000803e3d6000fd5b505050506040513d602081101561126d57600080fd5b81019080805190602001909291905050506040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b8381101561131b578082015181840152602081019050611300565b50505050905090810190601f1680156113485780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561136857600080fd5b505af115801561137c573d6000803e3d6000fd5b505050506040513d602081101561139257600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff1663d3e9af5a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561140957600080fd5b505af115801561141d573d6000803e3d6000fd5b505050506040513d602081101561143357600080fd5b8101908080519060200190929190505050600014156114e9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8090506020604051908101604052806000815250602060405190810160405280600081525060206040519081016040528060008152506020604051908101604052806000815250602060405190810160405280600081525060206040519081016040528060008152509950995099509950995099509950611cd0565b8173ffffffffffffffffffffffffffffffffffffffff16633dd2b61460006040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b15801561155957600080fd5b505af115801561156d573d6000803e3d6000fd5b505050506040513d602081101561158357600080fd5b8101908080519060200190929190505050905060008173ffffffffffffffffffffffffffffffffffffffff16639bca41e86040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825260088152602001807f73686172645f6964000000000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b15801561163857600080fd5b505af115801561164c573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561167657600080fd5b81019080805164010000000081111561168e57600080fd5b828101905060208101848111156116a457600080fd5b81518560018202830111640100000000821117156116c157600080fd5b50509291905050508273ffffffffffffffffffffffffffffffffffffffff16639bca41e86040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825260088152602001807f61737365745f6964000000000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b15801561176957600080fd5b505af115801561177d573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156117a757600080fd5b8101908080516401000000008111156117bf57600080fd5b828101905060208101848111156117d557600080fd5b81518560018202830111640100000000821117156117f257600080fd5b50509291905050508373ffffffffffffffffffffffffffffffffffffffff16639bca41e86040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600c8152602001807f66726f6d5f616464726573730000000000000000000000000000000000000000815250602001915050600060405180830381600087803b15801561189a57600080fd5b505af11580156118ae573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060208110156118d857600080fd5b8101908080516401000000008111156118f057600080fd5b8281019050602081018481111561190657600080fd5b815185600182028301116401000000008211171561192357600080fd5b50509291905050508473ffffffffffffffffffffffffffffffffffffffff16639bca41e86040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600a8152602001807f746f5f6164647265737300000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b1580156119cb57600080fd5b505af11580156119df573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611a0957600080fd5b810190808051640100000000811115611a2157600080fd5b82810190506020810184811115611a3757600080fd5b8151856001820283011164010000000082111715611a5457600080fd5b50509291905050508573ffffffffffffffffffffffffffffffffffffffff16639bca41e86040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600d8152602001807f7472616e736665725f7479706500000000000000000000000000000000000000815250602001915050600060405180830381600087803b158015611afc57600080fd5b505af1158015611b10573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611b3a57600080fd5b810190808051640100000000811115611b5257600080fd5b82810190506020810184811115611b6857600080fd5b8151856001820283011164010000000082111715611b8557600080fd5b50509291905050508673ffffffffffffffffffffffffffffffffffffffff16639bca41e86040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180806020018281038252600b8152602001807f6372656174655f74696d65000000000000000000000000000000000000000000815250602001915050600060405180830381600087803b158015611c2d57600080fd5b505af1158015611c41573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506020811015611c6b57600080fd5b810190808051640100000000811115611c8357600080fd5b82810190506020810184811115611c9957600080fd5b8151856001820283011164010000000082111715611cb657600080fd5b505092919050505086965099509950995099509950995099505b505050919395979092949650565b600080600061100191508173ffffffffffffffffffffffffffffffffffffffff166359a48b656040518163ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018080602001828103825260188152602001807f745f636f6c6c656374696f6e5f61737365745f73686172640000000000000000815250602001915050602060405180830381600087803b158015611d8857600080fd5b505af1158015611d9c573d6000803e3d6000fd5b505050506040513d6020811015611db257600080fd5b81019080805190602001909291905050509050809250505090565b60c06040519081016040528060608152602001606081526020016060815260200160608152602001606081526020016060815250905600a165627a7a72305820f651c2e23ed56c0e8052d0aaa64422cc6b4f580e3fb04657712b4a9e0cb2cc810029"};

    public static final String SM_BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {"[{\"constant\":false,\"inputs\":[{\"name\":\"shard_id\",\"type\":\"string\"},{\"name\":\"asset_id\",\"type\":\"string\"},{\"name\":\"from_address\",\"type\":\"string\"},{\"name\":\"to_address\",\"type\":\"string\"},{\"name\":\"transfer_type\",\"type\":\"string\"},{\"name\":\"create_time\",\"type\":\"string\"}],\"name\":\"add\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"shard_id\",\"type\":\"string\"}],\"name\":\"select\",\"outputs\":[{\"name\":\"\",\"type\":\"int256\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"ret\",\"type\":\"int256\"},{\"indexed\":false,\"name\":\"shard_id\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"asset_id\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"from_address\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"to_address\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"transfer_type\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"create_time\",\"type\":\"string\"}],\"name\":\"RegisterEvent\",\"type\":\"event\"}]"};

    public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY);

    public static final String FUNC_ADD = "add";

    public static final String FUNC_SELECT = "select";

    public static final Event REGISTEREVENT_EVENT = new Event("RegisterEvent", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
    ;

    protected DigitalAssetShard(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public TransactionReceipt add(String shard_id, String asset_id, String from_address, String to_address, String transfer_type, String create_time) {
        final Function function = new Function(
                FUNC_ADD, 
                Arrays.<Type>asList(new Utf8String(shard_id),
                new Utf8String(asset_id),
                new Utf8String(from_address),
                new Utf8String(to_address),
                new Utf8String(transfer_type),
                new Utf8String(create_time)),
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public TransactionReceipt add(String shard_id, String asset_id, String from_address, String to_address, String transfer_type, String create_time, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_ADD, 
                Arrays.<Type>asList(new Utf8String(shard_id),
                new Utf8String(asset_id),
                new Utf8String(from_address),
                new Utf8String(to_address),
                new Utf8String(transfer_type),
                new Utf8String(create_time)),
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public String getSignedTransactionForAdd(String shard_id, String asset_id, String from_address, String to_address, String transfer_type, String create_time) {
        final Function function = new Function(
                FUNC_ADD, 
                Arrays.<Type>asList(new Utf8String(shard_id),
                new Utf8String(asset_id),
                new Utf8String(from_address),
                new Utf8String(to_address),
                new Utf8String(transfer_type),
                new Utf8String(create_time)),
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple6<String, String, String, String, String, String> getAddInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_ADD, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple6<String, String, String, String, String, String>(

                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue(), 
                (String) results.get(4).getValue(), 
                (String) results.get(5).getValue()
                );
    }

    public Tuple1<BigInteger> getAddOutput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getOutput();
        final Function function = new Function(FUNC_ADD, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public Tuple7<BigInteger, String, String, String, String, String, String> select(String shard_id) throws ContractException {
        final Function function = new Function(FUNC_SELECT, 
                Arrays.<Type>asList(new Utf8String(shard_id)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Int256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple7<BigInteger, String, String, String, String, String, String>(
                (BigInteger) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue(), 
                (String) results.get(4).getValue(), 
                (String) results.get(5).getValue(), 
                (String) results.get(6).getValue());
    }

    public List<RegisterEventEventResponse> getRegisterEventEvents(TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = extractEventParametersWithLog(REGISTEREVENT_EVENT, transactionReceipt);
        ArrayList<RegisterEventEventResponse> responses = new ArrayList<RegisterEventEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            RegisterEventEventResponse typedResponse = new RegisterEventEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.ret = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.shard_id = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.asset_id = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.from_address = (String) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse.to_address = (String) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse.transfer_type = (String) eventValues.getNonIndexedValues().get(5).getValue();
            typedResponse.create_time = (String) eventValues.getNonIndexedValues().get(6).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeRegisterEventEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(REGISTEREVENT_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeRegisterEventEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(REGISTEREVENT_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public static DigitalAssetShard load(String contractAddress, Client client, CryptoKeyPair credential) {
        return new DigitalAssetShard(contractAddress, client, credential);
    }

    public static DigitalAssetShard deploy(Client client, CryptoKeyPair credential) throws ContractException {
        return deploy(DigitalAssetShard.class, client, credential, getBinary(client.getCryptoSuite()), "");
    }

    public static class RegisterEventEventResponse {
        public TransactionReceipt.Logs log;

        public BigInteger ret;

        public String shard_id;

        public String asset_id;

        public String from_address;

        public String to_address;

        public String transfer_type;

        public String create_time;
    }
}
